<?php
$task		= mosGetParam($_REQUEST, 'task', '');
$id			= intval(mosGetParam($_REQUEST, 'id', 0));

if ($task=='blogsection'){
	$sql = "SELECT id,title FROM #__sections WHERE id=".$id;
	$database->setQuery($sql);
	$database->loadObject($row);
	$navigation = '<a href="index.php">Trang chủ</a> >> '.$row->title;
}else if ($task=='blogcategory'){
	$sql = "SELECT id,title,section FROM #__categories WHERE id=".$id;
	$database->setQuery($sql);
	$database->loadObject($row);
	$sql = "SELECT id,title FROM #__sections WHERE id=".$row->section;
	$database->setQuery($sql);
	$database->loadObject($rowSec);
	$linkSec = sefRelToAbs("index.php?option=com_content&task=blogsection&id=".$rowSec->id);
	$navigation = '<a href="index.php">Trang chủ</a> >> <a href="'.$linkSec.'">'.$rowSec->title.'</a> >>'.$row->title;
}else if ($task=='view'){
	$sql = "SELECT id,title,catid,sectionid FROM #__content WHERE id=".$id;
	$database->setQuery($sql);
	$database->loadObject($row);
	$sql = "SELECT id,title FROM #__sections WHERE id=".$row->sectionid;
	$database->setQuery($sql);
	$database->loadObject($rowSec);
	$sql = "SELECT id,title FROM #__categories WHERE id=".$row->catid;
	$database->setQuery($sql);
	$database->loadObject($rowCat);
	$linkSec = sefRelToAbs("index.php?option=com_content&task=blogsection&id=".$rowSec->id);
	$linkCat = sefRelToAbs("index.php?option=com_content&task=blogcategory&id=".$rowCat->id);
	$navigation = '<a href="index.php">Trang chủ</a> >> <a href="'.$linkSec.'">'.$rowSec->title.'</a> >> <a href="'.$linkCat.'">'.$rowCat->title.'</a> >>'.$row->title;
}else{
	$navigation = 'Trang chủ';
}
echo $navigation;
?>